load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "jobsauth",
    srcs = ["authorization.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/jobs/jobsauth",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/jobs/jobspb",
        "//pkg/security/username",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/privilege",
        "//pkg/sql/roleoption",
    ],
)

go_test(
    name = "jobsauth_test",
    srcs = ["authorization_test.go"],
    deps = [
        ":jobsauth",
        "//pkg/ccl/changefeedccl",
        "//pkg/jobs/jobspb",
        "//pkg/security/username",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/privilege",
        "//pkg/sql/roleoption",
        "//pkg/sql/syntheticprivilege",
        "//pkg/util/randutil",
        "@com_github_stretchr_testify//assert",
    ],
)
